<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\OrderGoodsDetailBean;

class OrderGoodsDetailValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 OrderGoodsDetailBean::$id => 'require', //
			 OrderGoodsDetailBean::$orderGoodsId => 'require', //商品订单id
			 OrderGoodsDetailBean::$url => 'require|max:255', //文件地址
			 OrderGoodsDetailBean::$filePage => 'require', //文件页数
			 OrderGoodsDetailBean::$fileCount => 'require', //购买份数
			 OrderGoodsDetailBean::$createdAt => 'require', //
			 OrderGoodsDetailBean::$goodsPrice => 'require', //商品合计价格
		];
		$this->message = [
			OrderGoodsDetailBean::$id.POINST."require " => 'id必须', //
			OrderGoodsDetailBean::$orderGoodsId.POINST."require " => 'order_goods_id必须', //商品订单id
			OrderGoodsDetailBean::$url.POINST."require " => 'url必须', //文件地址
			OrderGoodsDetailBean::$filePage.POINST."require " => 'file_page必须', //文件页数
			OrderGoodsDetailBean::$fileCount.POINST."require " => 'file_count必须', //购买份数
			OrderGoodsDetailBean::$createdAt.POINST."require " => 'created_at必须', //
			OrderGoodsDetailBean::$goodsPrice.POINST."require " => 'goods_price必须', //商品合计价格
		];
		$this->scene = [
			self::$all => [
				OrderGoodsDetailBean::$id,
				OrderGoodsDetailBean::$orderGoodsId,
				OrderGoodsDetailBean::$url,
				OrderGoodsDetailBean::$filePage,
				OrderGoodsDetailBean::$fileCount,
				OrderGoodsDetailBean::$createdAt,
				OrderGoodsDetailBean::$goodsPrice,
			],
			self::$add => [
				OrderGoodsDetailBean::$orderGoodsId,
				OrderGoodsDetailBean::$url,
				OrderGoodsDetailBean::$filePage,
				OrderGoodsDetailBean::$fileCount,
			],
			self::$edit => [
				OrderGoodsDetailBean::$id,
				OrderGoodsDetailBean::$orderGoodsId,
				OrderGoodsDetailBean::$url,
				OrderGoodsDetailBean::$filePage,
				OrderGoodsDetailBean::$fileCount,
			],
			self::$pkId => [],

		];
	}


}
